package com.java.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class Courier {
    private int id;
    private String name;
    private String phone;
    private String ID_Card;
    private String password;
    private int numberOfPackages;
    private Timestamp createTime;
    private Timestamp loginTime;

    public Courier() {
    }

    public Courier(String name, String phone, String ID_Card, String password) {
        this.name = name;
        this.phone = phone;
        this.ID_Card = ID_Card;
        this.password = password;
    }

    public Courier(int id,String name, String phone, String ID_Card, String password, int numberOfPackages, Timestamp createTime, Timestamp loginTime) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.ID_Card = ID_Card;
        this.password = password;
        this.numberOfPackages = numberOfPackages;
        this.createTime = createTime;
        this.loginTime = loginTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getID_Card() {
        return ID_Card;
    }

    public void setID_Card(String ID_Card) {
        this.ID_Card = ID_Card;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getNumberOfPackages() {
        return numberOfPackages;
    }

    public void setNumberOfPackages(int numberOfPackages) {
        this.numberOfPackages = numberOfPackages;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Timestamp loginTime) {
        this.loginTime = loginTime;
    }

    @Override
    public String toString() {
        return "Courier{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", ID_Card='" + ID_Card + '\'' +
                ", password='" + password + '\'' +
                ", numberOfPackages=" + numberOfPackages +
                ", createTime=" + createTime +
                ", loginTime='" + loginTime + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Courier courier = (Courier) o;
        return id == courier.id &&
                numberOfPackages == courier.numberOfPackages &&
                Objects.equals(name, courier.name) &&
                Objects.equals(phone, courier.phone) &&
                Objects.equals(ID_Card, courier.ID_Card) &&
                Objects.equals(password, courier.password) &&
                Objects.equals(createTime, courier.createTime) &&
                Objects.equals(loginTime, courier.loginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, phone, ID_Card, password, numberOfPackages, createTime, loginTime);
    }
}
